package com.xsj.mapper;

import com.xsj.vo.Cart;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @BelongsProject: wisdom-restaurant-manage
 * @BelongsPackage: com.xsj.mapper
 * @Author: tutu
 * @CreateTime: 2025-06-17 15:54
 * @Description: TODO
 * @Version: 1.0
 */
@Mapper
public interface CartMapper {

    int addCart(Cart cart);

    List<Cart> findByUserIdAndMerchantId(@Param("userId") int userId, @Param("merchantId") int merchantId);

    //查询购物车
    List<Cart> findByUserId(int userId);

    // 根据商品ID列表批量删除
    int deleteByGoodIds(@Param("userId") int userId, @Param("merchantId") int merchantId, @Param("goodIds") List<Integer> goodIds);

    int deleteGoodByMySQL(@Param("userId") int userId, @Param("merchantId") int merchantId , @Param("goodId") int goodId);

}
